home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 31
/
Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso
/
Aminet
/
dev
/
gui
/
gui4cli.lha
/
Gui4Cli
/
Docs
/
Tutorials
/
ChangeArg.gc
< prev
next >
Wrap
Text File
|
1999-04-21
|
3KB
|
138 lines
G4C
; Shows the use of ChangeArg, ChangeGad, SetGad and PartRedraw
; ------------------------------------------------------------
WINBIG 179 50 292 148 "ChangeArg.gc"
WinType 11110001
BOX 0 0 0 0 OUT button ; decorative boxes
BOX 10 5 272 63 in button
BOX 10 75 271 69 in button
; ------------------------------------------------------------
; System events
; ------------------------------------------------------------
xonLoad
GuiOpen ChangeArg.gc
xonClose
GuiQuit ChangeArg.gc
; ------------------------------------------------------------
; The speciment (a button)
; ------------------------------------------------------------
; The button takes 5 arguments: Left Top Width Height Title
; These are counted from 0 to 4 (i.e. Left=0.. Title=4)
XBUTTON 90 30 120 12 'The Specimen'
gadid 1
; ------------------------------------------------------------
; The buttons which do the dirty deeds..
; ------------------------------------------------------------
; We give gadid's to the buttons because we'll set them on/off
; when we SHOW/HIDE the "Specimen". Since we do the same to all
; of them, we give them the same id - No.2
; -------------------
XBUTTON 25 80 90 15 'Left'
GadId 2
; In gadid 1, change arg 0 ('Left') to 30
ChangeArg ChangeArg.gc 1 0 30
; The gui must be redrawn for the change to be visible.
; We use PartRedraw to Redraw part of the window.
; We could have used the Redraw command which will redraw
; the full window, but we only change a part of it so no need.
PartRedraw ChangeArg.gc 11 6 268 55
; -------------------
XBUTTON 25 95 90 15 'Top'
GadId 2
; Change argument number 1 ('top') to 40, and redraw.
ChangeArg ChangeArg.gc 1 1 40
PartRedraw ChangeArg.gc 11 6 268 55
; -------------------
XBUTTON 25 110 90 15 'Width'
GadId 2
; change the width to 180
ChangeArg ChangeArg.gc 1 2 180
PartRedraw ChangeArg.gc 11 6 268 55
; -------------------
XBUTTON 25 125 90 15 'Height'
GadId 2
; Change argument number 3 ('height') to 16, and redraw.
ChangeArg ChangeArg.gc 1 3 16
PartRedraw ChangeArg.gc 11 6 268 55
; -------------------
XBUTTON 175 80 90 15 'Title'
GadId 2
; Change argument number 4 ('title'), and redraw.
; Length of new title is padded to length of old.
; If new title is to be made longer than the original,
; then the original should be padded with spaces to
; allow for the extra length.
ChangeArg ChangeArg.gc 1 4 'New title '
PartRedraw ChangeArg.gc 11 6 268 55
; -------------------
XBUTTON 175 95 90 15 "Hide"
GadId 2
; Hide the Specimen button, using SetGad
SetGad ChangeArg.gc 1 HIDE
; and redraw to make gadget disappear
PartRedraw ChangeArg.gc 11 6 268 55
; Set all other gadgets off, except the "Show" button
; below, forcing the user to turn us back on..
SetGad ChangeArg.gc 2 OFF
; -------------------
XBUTTON 175 110 90 15 "Show"
; no id here, since we want this gad to always be "on"
; Show the Specimen button again..
SetGad ChangeArg.gc 1 SHOW
PartRedraw ChangeArg.gc 11 6 268 55
; Set all other gadgets back on
SetGad ChangeArg.gc 2 ON
; -------------------
XBUTTON 175 125 90 15 'RESET'
GadId 2
; Here we want to change all the gadget's attributes back
; to the original, so we use CHANGEGAD to set them all in
; one go..
ChangeGad ChangeArg.gc 1 90 30 120 12 'The Specimen'
PartRedraw ChangeArg.gc 11 6 268 55